10 KEY OFF:PRINT:CLS:N$="IBM PC User Group of Greater Kansas City":N2$="Keith D. Barber - Librarian":PRINT TAB(19) N$:PRINT :PRINT TAB(25) N2$:FOR T=1 TO 1000 :NEXT T:CLS:N4$="REGRESSION ANALYSES":PRINT TAB(30) N4$:PRINT
20 PRINT "This program fits a straight line, a geometric curve, and an exponential curve to a given set of coordinates using the method of least squares.":X$=CHR$(253)
30 PRINT "The equation of each curve,the respective coefficient of determination (R ";X$;"),";"coefficient of correlation (R), and standard error of estimate are printed.":PRINT :PRINT "The form of the three equations are:" :PRINT
50 PRINT :INPUT "Enter date in the form of `00/00/83' ",N3$:PRINT :INPUT "Enter your initials: ",KB$:PRINT :INPUT "Enter client's name: ", N5$:PRINT :INPUT "Enter project number: ",N6$
60 PRINT :PRINT "The `X' value will represent ";:COLOR 0,7:PRINT " ";:COLOR 7,0:PRINT ".":LOCATE 21,30:INPUT " ",N7$
70 PRINT :PRINT "The `Y' value will represent ";:COLOR 0,7:PRINT " ";:COLOR 7,0:PRINT ".":LOCATE 23,30:INPUT " ",N8$:CLS:PRINT TAB(21) N$:PRINT TAB(26) N2$:PRINT:PRINT TAB(30) N4$:PRINT :PRINT N5$; TAB(66) "By ";KB$
80 PRINT "Project No. "; N6$; TAB(66) "Date ";N3$
85 ON ERROR GOTO 500
90 PRINT :PRINT "Total number of points =";:INPUT " ",N:SX=0:SGX=0:SY=0:SGY=0:SX2=0:SGX2=0:SY2=0:SGY2=0:SXY=0:SGXY=0:SEXY=0:R2=0::Z=0:FOR I=1 TO N:PRINT " X,Y value of point";I;"=";:INPUT " ",X(I),Y(I):NEXT I
91 PRINT "List Data (y/n) ?"
92 C$=INKEY$:IF C$="" THEN 92
93 IF LEFT$(C$,1) ="y" OR LEFT$(C$,1) ="Y" THEN INPUT "Data Range (Point1,Point 2) ",P1,P2:CLS:PRINT ," I"," X"," Y":PRINT ," -----"," -----"," -----":FOR I = P1 TO P2:PRINT ," Point ";I,X(I),Y(I):NEXT I:GOTO 91
94 PRINT "Edit Data (y/n) ?"
95 C$=INKEY$:IF C$="" THEN 95
96 IF LEFT$(C$,1) ="y" OR LEFT$(C$,1) ="Y" THEN INPUT "Point Number (I) ";I:PRINT "X,Y Value of point";I;: INPUT X(I),Y(I):GOTO 91
99 FOR I=1 TO N:X=X(I):Y=Y(I):IF X>0 THEN XG=LOG(X) ELSE XG=-5
210 Y1=M*X+B:YG=EXP(BG)*X^MG:YE=EXP(BE)*EXP(ME)^X:PRINT:Z=Z+1:IF Z=17 THEN Z=0:GOTO 190
220 LOCATE 7+Z,10:PRINT ,X,Y1,YG,YE:GOTO 200
230 LOCATE 9+Z:PRINT " Analyze more data (y/n)"
234 A$=INKEY$: IF A$="" THEN 234
236 IF LEFT$(A$,1)="y" OR LEFT$(A$,1)="Y" THEN CLS:GOTO 90
240 LOAD"menu",R
250 WIDTH "lpt1:",132:LPRINT CHR$(15):GOSUB 300:LPRINT :LPRINT:LPRINT TAB(35)"Point" TAB(55) "X Value (a)"TAB(75)"Y Value (b)":LPRINT TAB(34)"-------" TAB(54) "-------------"TAB(74)"-------------":FOR I=1 TO N
260 LPRINT TAB(33);I;TAB(60);X(I);TAB(80);Y(I):NEXT I:LPRINT:LPRINT TAB(35)"(a) The `X' value represents ";N7$;".":LPRINT TAB(35)"(b) The `Y' value represents ";N8$;".":IF N>24 THEN LPRINT CHR$(12): GOSUB 300
270 LPRINT :LPRINT:K=43:KB=56:LPRINT TAB(KB+1) "LINEAR REGRESSION":LPRINT:LPRINT TAB(K+7) "Y =";M;SG$;B$:LPRINT :LPRINT TAB(K)"Coefficient of Determination (R2) =";R2:LPRINT TAB(K)"Coefficient of Correlation (R) =";SQR(R2):LPRINT
280 LPRINT TAB(KB) "GEOMETRIC REGRESSION":LPRINT :LPRINT TAB(K+7)"Y =";EXP(BG);" * X ^";MG:LPRINT :LPRINT TAB(K)"Coefficient of Determination (R2) =";RG2:LPRINT TAB(K)"Coefficient of Correlation (R) =";SQR(RG2):LPRINT
500 IF ERR=27 OR ERR=25 THEN PLAY"T110L8MSD4MNO3GABO4CD4O3MSG4MNG4O4MSE4MNCDEF#G4O3MSG4MNG4MSO4C4MNDCO3BAMSB4MN04CO3BAG":PRINT "TURN PRINTER ON":RESUME 250